<?php //get_component('categoriesLeftMenuWidget', 'render')   ?>
<?php //get_component('bottomArticlesWidget', 'render')   ?>
<?php slot('article') ?>
<?php use_stylesheet('/faye/jquery.fancybox-1.3.1.css') ?>
<?php use_javascript('/faye/js/jquery.fancybox-1.3.1.js') ?>
<div class="maincontent">
  <div class="contentbox">
	<div class="contentboxin">
	  <div class="boxintopleft">
		<?php include_component('headerMenu', 'breadCrumbs') ?>
	  </div>
	  <div class="boxintopright">
		<div class="boxtoplink">
		  <img width="12" height="12" alt="" src="/olly/img/print.png">
		  <a href="<?php include_component('linker', 'printView', array('node' => $node)) ?>"><?php echo __('Print') ?></a>
		  <div class="clear"></div>
		</div>
		<?php include_partial('article/share') ?>
	  </div>
	  <div class="clear"></div>
	  <div class="boxinpealkiri">
		<h1><?php echo $node->getTitle() ?></h1>
	  </div>
	  <div class="tabstext">
		<div class="tabbox" style="padding: 0;">
		  <?php echo $node->getContent() ?>
		  <?php foreach ($pictures as $index => $pic): ?>
			<?php if ($index % 3 == 0): ?>
			  <div class="tabgallery">
			  <?php endif; ?>


			  <?php
			  switch ($index % 3) {
				case '0':
				  $class = 'left';
				  break;
				case '1':
				  $class = 'center';
				  break;
				case '2':
				  $class = 'right';
				  break;
			  }
			  ?>
  			<div class="tg<?php echo $class ?>">
  			  <a rel="pic_group" href="<?php echo @myPicture::getInstance($pic['file'])->url() ?>" title="<?php echo $pic['name'] ?>"><img width="178" height="136" alt="" src="<?php echo @myPicture::getInstance($pic['file'])->thumbnail(178, 136, 'center')->url() ?>"></a>
  			</div>


			  <?php if ($index % 3 == 2 || $index + 1 == count($pictures)): ?>
				<div class="clear"></div>
			  </div>
			<?php endif ?>

		  <?php endforeach; ?>
		</div>						
	  </div>
	</div>
  </div>
</div>
<script type="text/javascript">
  $("a[rel=pic_group]").fancybox({
	'transitionIn'		: 'none',
	'transitionOut'		: 'none',
	'showCloseButton'   : 'true',
	'showNavArrows'     : 'true',
	'enableEscapeButton': 'true',
    'overlayOpacity'    : '0.8',
	'cyclic'            : 'true',
	'overlayColor'      : '#000',
	'titlePosition' 	: 'outside',
	'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
	  return '<span id="fancybox-title-over">'+ (title.length ? ' &nbsp; ' + title : '') + '</span>';
	}
  });

</script>
<?php end_slot() ?>
<?php
//include_component('productPage', 'pageLayout') ?>